Optimal. Leaf size=107 \[ a (c-i d)^3 x+\frac {a (i c+d)^3 \log (\cos (e+f x))}{f}+\frac {i a (c-i d)^2 d \tan (e+f x)}{f}+\frac {a (i c+d) (c+d \tan (e+f x))^2}{2 f}+\frac {i a (c+d \tan (e+f x))^3}{3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 107, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.115, Rules used = {3609, 3606,
3556} \begin {gather*} \frac {i a d (c-i d)^2 \tan (e+f x)}{f}+\frac {i a (c+d \tan (e+f x))^3}{3 f}+\frac {a (d+i c) (c+d \tan (e+f x))^2}{2 f}+\frac {a (d+i c)^3 \log (\cos (e+f x))}{f}+a x (c-i d)^3 \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3556
Rule 3606
Rule 3609
Rubi steps
\begin {align*} \int (a+i a \tan (e+f x)) (c+d \tan (e+f x))^3 \, dx &=\frac {i a (c+d \tan (e+f x))^3}{3 f}+\int (c+d \tan (e+f x))^2 (a (c-i d)+a (i c+d) \tan (e+f x)) \, dx\\ &=\frac {a (i c+d) (c+d \tan (e+f x))^2}{2 f}+\frac {i a (c+d \tan (e+f x))^3}{3 f}+\int \left (a (c-i d)^2+i a (c-i d)^2 \tan (e+f x)\right ) (c+d \tan (e+f x)) \, dx\\ &=a (c-i d)^3 x+\frac {i a (c-i d)^2 d \tan (e+f x)}{f}+\frac {a (i c+d) (c+d \tan (e+f x))^2}{2 f}+\frac {i a (c+d \tan (e+f x))^3}{3 f}-\left (a (i c+d)^3\right ) \int \tan (e+f x) \, dx\\ &=a (c-i d)^3 x+\frac {a (i c+d)^3 \log (\cos (e+f x))}{f}+\frac {i a (c-i d)^2 d \tan (e+f x)}{f}+\frac {a (i c+d) (c+d \tan (e+f x))^2}{2 f}+\frac {i a (c+d \tan (e+f x))^3}{3 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(219\) vs. \(2(107)=214\).
time = 3.47, size = 219, normalized size = 2.05 \begin {gather*} \frac {(\cos (f x)-i \sin (f x)) \left (12 (c-i d)^3 f x \cos (e+f x) (\cos (e)-i \sin (e))-6 (c-i d)^3 \text {ArcTan}(\tan (2 e+f x)) \cos (e+f x) (\cos (e)-i \sin (e))-3 i (c-i d)^3 \cos (e+f x) \log \left (\cos ^2(e+f x)\right ) (\cos (e)-i \sin (e))-2 d \left (-9 c^2+9 i c d+4 d^2\right ) \sin (f x) (i+\tan (e))+2 d^3 \sec ^2(e+f x) \sin (f x) (i+\tan (e))+d^2 \cos (e) \sec (e+f x) (i+\tan (e)) (9 c-3 i d+2 d \tan (e))\right ) (a+i a \tan (e+f x))}{6 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 155, normalized size = 1.45
method | result | size |
norman | \(\left (-3 i a \,c^{2} d +i a \,d^{3}+a \,c^{3}-3 a c \,d^{2}\right ) x +\frac {\left (3 i a c \,d^{2}+a \,d^{3}\right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}+\frac {i a \,d^{3} \left (\tan ^{3}\left (f x +e \right )\right )}{3 f}-\frac {i a d \left (3 i c d -3 c^{2}+d^{2}\right ) \tan \left (f x +e \right )}{f}-\frac {\left (-i a \,c^{3}+3 i a c \,d^{2}-3 a \,c^{2} d +a \,d^{3}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f}\) | \(149\) |
derivativedivides | \(\frac {a \left (\frac {i d^{3} \left (\tan ^{3}\left (f x +e \right )\right )}{3}+\frac {3 i c \,d^{2} \left (\tan ^{2}\left (f x +e \right )\right )}{2}+3 i c^{2} d \tan \left (f x +e \right )-i d^{3} \tan \left (f x +e \right )+\frac {d^{3} \left (\tan ^{2}\left (f x +e \right )\right )}{2}+3 c \,d^{2} \tan \left (f x +e \right )+\frac {\left (i c^{3}-3 i c \,d^{2}+3 c^{2} d -d^{3}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (-3 i c^{2} d +i d^{3}+c^{3}-3 c \,d^{2}\right ) \arctan \left (\tan \left (f x +e \right )\right )\right )}{f}\) | \(155\) |
default | \(\frac {a \left (\frac {i d^{3} \left (\tan ^{3}\left (f x +e \right )\right )}{3}+\frac {3 i c \,d^{2} \left (\tan ^{2}\left (f x +e \right )\right )}{2}+3 i c^{2} d \tan \left (f x +e \right )-i d^{3} \tan \left (f x +e \right )+\frac {d^{3} \left (\tan ^{2}\left (f x +e \right )\right )}{2}+3 c \,d^{2} \tan \left (f x +e \right )+\frac {\left (i c^{3}-3 i c \,d^{2}+3 c^{2} d -d^{3}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (-3 i c^{2} d +i d^{3}+c^{3}-3 c \,d^{2}\right ) \arctan \left (\tan \left (f x +e \right )\right )\right )}{f}\) | \(155\) |
risch | \(-\frac {2 i a \,d^{3} e}{f}-\frac {i a \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) c^{3}}{f}+\frac {3 i a \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) c \,d^{2}}{f}+\frac {6 i a \,c^{2} d e}{f}-\frac {2 a \,c^{3} e}{f}+\frac {6 a c \,d^{2} e}{f}+\frac {2 a d \left (18 i c d \,{\mathrm e}^{4 i \left (f x +e \right )}-9 c^{2} {\mathrm e}^{4 i \left (f x +e \right )}+9 d^{2} {\mathrm e}^{4 i \left (f x +e \right )}+27 i c d \,{\mathrm e}^{2 i \left (f x +e \right )}-18 c^{2} {\mathrm e}^{2 i \left (f x +e \right )}+9 d^{2} {\mathrm e}^{2 i \left (f x +e \right )}+9 i c d -9 c^{2}+4 d^{2}\right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}-\frac {3 a \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) c^{2} d}{f}+\frac {a \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) d^{3}}{f}\) | \(253\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.51, size = 150, normalized size = 1.40 \begin {gather*} -\frac {-2 i \, a d^{3} \tan \left (f x + e\right )^{3} + 3 \, {\left (-3 i \, a c d^{2} - a d^{3}\right )} \tan \left (f x + e\right )^{2} - 6 \, {\left (a c^{3} - 3 i \, a c^{2} d - 3 \, a c d^{2} + i \, a d^{3}\right )} {\left (f x + e\right )} + 3 \, {\left (-i \, a c^{3} - 3 \, a c^{2} d + 3 i \, a c d^{2} + a d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 6 \, {\left (-3 i \, a c^{2} d - 3 \, a c d^{2} + i \, a d^{3}\right )} \tan \left (f x + e\right )}{6 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 288 vs. \(2 (95) = 190\).
time = 1.08, size = 288, normalized size = 2.69 \begin {gather*} -\frac {18 \, a c^{2} d - 18 i \, a c d^{2} - 8 \, a d^{3} + 18 \, {\left (a c^{2} d - 2 i \, a c d^{2} - a d^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 18 \, {\left (2 \, a c^{2} d - 3 i \, a c d^{2} - a d^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + 3 \, {\left (i \, a c^{3} + 3 \, a c^{2} d - 3 i \, a c d^{2} - a d^{3} + {\left (i \, a c^{3} + 3 \, a c^{2} d - 3 i \, a c d^{2} - a d^{3}\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, {\left (i \, a c^{3} + 3 \, a c^{2} d - 3 i \, a c d^{2} - a d^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, {\left (i \, a c^{3} + 3 \, a c^{2} d - 3 i \, a c d^{2} - a d^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{3 \, {\left (f e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 223 vs. \(2 (88) = 176\).
time = 0.50, size = 223, normalized size = 2.08 \begin {gather*} - \frac {i a \left (c - i d\right )^{3} \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{f} + \frac {- 18 a c^{2} d + 18 i a c d^{2} + 8 a d^{3} + \left (- 36 a c^{2} d e^{2 i e} + 54 i a c d^{2} e^{2 i e} + 18 a d^{3} e^{2 i e}\right ) e^{2 i f x} + \left (- 18 a c^{2} d e^{4 i e} + 36 i a c d^{2} e^{4 i e} + 18 a d^{3} e^{4 i e}\right ) e^{4 i f x}}{3 f e^{6 i e} e^{6 i f x} + 9 f e^{4 i e} e^{4 i f x} + 9 f e^{2 i e} e^{2 i f x} + 3 f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 597 vs. \(2 (95) = 190\).
time = 0.75, size = 597, normalized size = 5.58 \begin {gather*} \frac {-3 i \, a c^{3} e^{\left (6 i \, f x + 6 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 9 \, a c^{2} d e^{\left (6 i \, f x + 6 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 9 i \, a c d^{2} e^{\left (6 i \, f x + 6 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 3 \, a d^{3} e^{\left (6 i \, f x + 6 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 9 i \, a c^{3} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 27 \, a c^{2} d e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 27 i \, a c d^{2} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 9 \, a d^{3} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 9 i \, a c^{3} e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 27 \, a c^{2} d e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 27 i \, a c d^{2} e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 9 \, a d^{3} e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 18 \, a c^{2} d e^{\left (4 i \, f x + 4 i \, e\right )} + 36 i \, a c d^{2} e^{\left (4 i \, f x + 4 i \, e\right )} + 18 \, a d^{3} e^{\left (4 i \, f x + 4 i \, e\right )} - 36 \, a c^{2} d e^{\left (2 i \, f x + 2 i \, e\right )} + 54 i \, a c d^{2} e^{\left (2 i \, f x + 2 i \, e\right )} + 18 \, a d^{3} e^{\left (2 i \, f x + 2 i \, e\right )} - 3 i \, a c^{3} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 9 \, a c^{2} d \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 9 i \, a c d^{2} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 3 \, a d^{3} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 18 \, a c^{2} d + 18 i \, a c d^{2} + 8 \, a d^{3}}{3 \, {\left (f e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.07, size = 122, normalized size = 1.14 \begin {gather*} \frac {\mathrm {tan}\left (e+f\,x\right )\,\left (3{}\mathrm {i}\,a\,c^2\,d+3\,a\,c\,d^2-1{}\mathrm {i}\,a\,d^3\right )}{f}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (1{}\mathrm {i}\,a\,c^3+3\,a\,c^2\,d-3{}\mathrm {i}\,a\,c\,d^2-a\,d^3\right )}{f}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {a\,d^3}{2}+\frac {3{}\mathrm {i}\,a\,c\,d^2}{2}\right )}{f}+\frac {a\,d^3\,{\mathrm {tan}\left (e+f\,x\right )}^3\,1{}\mathrm {i}}{3\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________